<%-- 
    Document   : listadoPeliculas
    Created on : 27-dic-2011, 21:48:23
    Author     : bruno
--%>
<%@taglib  prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Lista de peliculas</title>
    </head>
    <body>
        <div id="bodydiv">
            <span style="color: #0395CC; margin-top: 20px; font-size: 20pt; font-family: Arial;"><b>Lista de peliculas</b></span>
            <hr />
            <br />
            <c:choose>
                <c:when test="${not empty sessionScope.peliculas}">
                    <c:forEach var="pelicula" items="${sessionScope.peliculas}">
                        <table style="margin-left: 120px;">
                            <th style="font-size: 12px;">${pelicula.nombre}</th>
                            <tr>
                                <td>
                                    <table style="border: 1px solid #666666">
                                        <tr style="background-color: #FFFFFF">
                                            <td style="width: 120px; background-color: #FFFFFF"><b>Estreno</b></td>
                                            <td style="width: 400px;"><fmt:formatDate value="${pelicula.fechaEstreno}" dateStyle="medium" pattern="dd/MM/yyyy"></fmt:formatDate></td>
                                        </tr>
                                        <tr style="background-color: gainsboro; border: 1px solid #666666">
                                            <td style="width: 120px;"><b>Edades</b></td>
                                            <td style="width: 400px;">${pelicula.edadApta}</td>
                                        </tr>
                                        <tr style="background-color: #FFFFFF">
                                            <td style="width: 120px;"><b>Idioma</b></td>
                                            <td style="width: 400px;">${pelicula.idioma}</td>
                                        </tr>
                                        <tr style="background-color: gainsboro; border: 1px solid #666666">
                                            <td style="width: 120px;"><b>Tipo proyeccion</b></td>
                                            <td style="width: 400px;">${pelicula.tipoProyeccion}</td>
                                        </tr>
                                        <tr style="background-color: #FFFFFF">
                                            <td style="width: 120px;"><b>Director</b></td>
                                            <td style="width: 400px;">${pelicula.director}</td>
                                        </tr>
                                        <tr style="background-color: gainsboro; border: 1px solid #666666">
                                            <td style="width: 120px;"><b>Actores</b></td>
                                            <td style="width: 400px;">${pelicula.actores}</td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td><b>Descripcion</b></td>
                            </tr>
                            <tr>
                                <td style="width: 250px;background-color: #FFFFFF; border: 1px solid #666666">
                                    ${pelicula.descripcion}
                                </td>
                            </tr>
                        </table>
                        <hr />
                        <br />
                        <br />
                    </c:forEach>
                </c:when>
                <c:otherwise>
                    <script>
                        location.href = "listadoPeliculas";
                    </script>
                </c:otherwise>
            </c:choose>
            <c:remove scope="session" var="peliculas" />
            <c:if test="${not empty sessionScope.error}">
                <span style="color: red">${sessionScope.error}</span>
            </c:if>
        </div>
        <jsp:include page="index.jsp" />
    </body>
</html>
